package com.fc.happyteam.service.impl;

import com.fc.happyteam.dao.BaseDao;
import com.fc.happyteam.service.BaseService;

import java.util.List;
import java.util.Map;

public abstract class BaseServiceImpl<T> implements BaseService<T> {

    public abstract BaseDao getDao();

    @Override
    public T queryObject(Long id) {
        return (T) getDao().queryObject(id);
    }

    @Override
    public void save(T entity) {
        getDao().save(entity);
    }

    @Override
    public void update(T entity) {
        getDao().update(entity);
    }

    @Override
    public void delete(Long id) {
        getDao().delete(id);
    }

    @Override
    public List<T> queryList(Map<String, Object> map) {
        return getDao().queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return getDao().queryTotal(map);
    }
}
